﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;


namespace GlobalGameClasses
{
    /// <summary>
    /// This class manages the entire content of the game.
    /// </summary>
    public class ContentCollection
    {

        public Dictionary<string, Model> Models
        {
            get;
            private set;
        }

        public Dictionary<string, Texture2D> Textures
        {
            get;
            private set;
        }

        public Dictionary<string, Effect> Effects
        {
            get;
            private set;
        }

        public Dictionary<string, SpriteFont> Fonts
        {
            get;
            private set;
        }

        public Dictionary<string, Song> Songs
        {
            get;
            private set;
        }

        public Dictionary<string, SoundEffect> GameSounds
        {
            get;
            private set;
        }

        public void addSound(string key, SoundEffect sound)
        {
            if (!GameSounds.Keys.Contains(key))
            GameSounds.Add(key, sound);
        }

        public void addContent(string key, Model model, Texture2D texture)
        {
            if (!Textures.Keys.Contains(key))
            {
                Textures.Add(key, texture);
            }
            if (!Models.Keys.Contains(key))
            {
                Models.Add(key, model);
            }
        }

        public void addTexture(string key, Texture2D texture)
        {
            if (!Textures.Keys.Contains(key))
            Textures.Add(key, texture);
        }

        public void addEffect(string key, Effect effect)
        {
            if (!Effects.Keys.Contains(key))
            Effects.Add(key, effect);
        }

        public void addFont(string key, SpriteFont font)
        {
            if (!Fonts.Keys.Contains(key))
            Fonts.Add(key, font);
        }

        public void addSong(string key, Song songs)
        {
            if (!Songs.Keys.Contains(key))
            Songs.Add(key, songs);
        }

        public ContentCollection()
        {
            Models = new Dictionary<string,Model>();
            Textures = new Dictionary<string,Texture2D>();
            Effects = new Dictionary<string, Effect>();
            Fonts = new Dictionary<string, SpriteFont>();
            GameSounds = new Dictionary<string, SoundEffect>();
            Songs = new Dictionary<string, Song>();
        }

    }
}

